package com.tckdq.tcc.exception;

import com.tckdq.tcc.enums.ErrorCodeEnum;
import lombok.Data;

@Data
public class BusinessException extends RuntimeException {
    private String errorMsg;
    private String errorCode;

    /*public BusinessException(String errorMsg, String errorCode) {
        super(errorMsg);
        this.errorMsg = errorMsg;
        this.errorCode = errorCode;
    }*/

    public BusinessException(ErrorCodeEnum errorCode) {
        super(errorCode.getMsg());
        this.errorMsg = errorCode.getMsg();
        this.errorCode = errorCode.getCode();
    }

}
